package mapper

/**
新建Mapper，需要：
1）制作Mapper.go文件
1.1）修改外部可引用的包内全局变量名称var TblSysDicMapper
1.2）修改外部可引用的包内全局结构体名称type TblSysDicMapperStruct struct
1.3）修改TblSysDicMapper变量的Name和Gdbcname属性
1.4）修改结构体字段type TblSysDic struct
1.5）修改方法名归属的结构体func (mapper TblSysDicMapperStruct)......
1.6）修改全局返回结构体类型var TblSysDic_type = reflect.TypeOf(TblSysDic{})
1.7）修改SELECTBYPK返回结构体类型MapperModule.SELECTBYPK_TEMPLATE(mapper.createMapperModule(),istruct,&TblSysDic_type)
2）制作Mapper.xml文件
2.1）写好每一个SQL
 */

import (
	"gdbc/gdbc/MapperModule"
	"reflect"
	"database/sql"
)

var TblSysDicMapper = TblSysDicMapperStruct{
	Name:     "TblSysDicMapper",
	Gdbcname: "default",
}
/**字段不能随意删除，必须与MapperModule.CreateMapperModule保持一致*/
type TblSysDicMapperStruct struct {
	Name     string
	Gdbcname string
}

type TblSysDic struct {
	Id          int
	L1_code     string
	L1_desc     string
	L2_code     string
	L2_desc     string
	Code_param  string
	Code_value  string
	Code_idx    int
	Live_count  int
	Create_time string
	Up_time     string
}

var TblSysDic_type = reflect.TypeOf(TblSysDic{})

func (mapper TblSysDicMapperStruct) InsertOne(tx *sql.Tx,istruct interface{}) int {
	return MapperModule.INSERTONE_TEMPLATE(MapperModule.CreateMapperModule(tx,mapper), istruct)
}
func (mapper TblSysDicMapperStruct) SelectByPk(tx *sql.Tx,istruct interface{}) (interface{}) {
	return MapperModule.SELECTBYPK_TEMPLATE(MapperModule.CreateMapperModule(tx,mapper), istruct, &TblSysDic_type)
}
func (mapper TblSysDicMapperStruct) UpdateByPk(tx *sql.Tx,istruct interface{}) int {
	return MapperModule.UPDATEBYPK_TEMPLATE(MapperModule.CreateMapperModule(tx,mapper), istruct)
}
func (mapper TblSysDicMapperStruct) DeleteByPk(tx *sql.Tx,istruct interface{}) int {
	return MapperModule.DELETEBYPK_TEMPLATE(MapperModule.CreateMapperModule(tx,mapper), istruct)
}
func (mapper TblSysDicMapperStruct) SelectOne(tx *sql.Tx,istruct interface{}) (interface{}) {
	return MapperModule.SELECTONE_TEMPLATE(MapperModule.CreateMapperModule(tx,mapper), istruct, &TblSysDic_type)
}
func (mapper TblSysDicMapperStruct) SelectList(tx *sql.Tx,istruct interface{}) ([]interface{}) {
	return MapperModule.SELECTLIST_TEMPLATE(MapperModule.CreateMapperModule(tx,mapper), istruct, &TblSysDic_type)
}
func (mapper TblSysDicMapperStruct) QueryOneMap(tx *sql.Tx,parammap map[string]interface{}) (map[string]interface{}) {
	return MapperModule.QUERYONEMAP_TEMPLATE(MapperModule.CreateMapperModule(tx,mapper), parammap)
}
func (mapper TblSysDicMapperStruct) QueryListMap(tx *sql.Tx,parammap map[string]interface{}) ([]map[string]interface{}) {
	return MapperModule.QUERYLISTMAP_TEMPLATE(MapperModule.CreateMapperModule(tx,mapper), parammap)
}
func (mapper TblSysDicMapperStruct) QueryForPage(tx *sql.Tx,parammap map[string]interface{}) ([]map[string]interface{}) {
	return MapperModule.QUERYFORPAGE_TEMPLATE(MapperModule.CreateMapperModule(tx,mapper), parammap)
}
func (mapper TblSysDicMapperStruct) UpdateCAS(tx *sql.Tx,parammap map[string]interface{}) (int) {
	return MapperModule.UPDATECAS_TEMPLATE(MapperModule.CreateMapperModule(tx,mapper), parammap)
}
func (mapper TblSysDicMapperStruct) InsertBatch(tx *sql.Tx,parammap []map[string]interface{}) (int) {
	return MapperModule.INSERTBATCH_TEMPLATE(MapperModule.CreateMapperModule(tx,mapper), parammap)
}
func (mapper TblSysDicMapperStruct) UpdateBatch(tx *sql.Tx,parammap []map[string]interface{}) (int) {
	return MapperModule.UPDATEBATCH_TEMPLATE(MapperModule.CreateMapperModule(tx,mapper), parammap)
}
